Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding parent document retrieval in default RAG pipeline #233

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

star-nox
Copy link
Member

No description provided.

Copy link

You need to setup a payment method to use Lintrule

You can fix that by putting in a card here.

@star-nox star-nox marked this pull request as draft March 13, 2024 20:31
@star-nox star-nox marked this pull request as ready for review March 14, 2024 16:57
@star-nox star-nox requested a review from rohan-uiuc March 14, 2024 16:57
Copy link
Contributor

@rohan-uiuc rohan-uiuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some performance improvements

  • Extract all sql documents in a single db call moving it out of the executor.
  • Remove redundant formatting of types by looping over all docs. 2 sequential and 1 parallel loop can be reduced to a single parallel loop.
  • Let's compare the API response time with current code and suggested improvements.

@star-nox
Copy link
Member Author

Changes made:

  1. Removed redundant call to format_for_json_mqr() at the end of getTopContexts(). The contexts are already formatted in context padding.
  2. Querying SQL data for top 5 contexts at once (making queries based on either urls or s3_paths) and supplying it to supabase_context_padding. Now performing 2 SQL queries (worst case) instead of 5.
  3. Modified padding functions to remove key checks in dictionaries.

Total context retrieval time ranges from 2.5s to 4s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants